#include "mgame.h"
#include "ui_mgame.h"
#include<qrect.h>

Mgame::Mgame(QWidget *parent) :
    QMainWindow(parent),
    ui(new Ui::Mgame)
{
    ui->setupUi(this);
    this->setGeometry(QRect(1620,920,1620,920));
}

Mgame::~Mgame()
{
    delete ui;
}

//画图
void Mgame::paintEvent(QPaintEvent *event){
    QPainter painter(this);
    //游戏背景
    //窗口边缘
    painter.setPen(Qt::black);//画笔颜色
    painter.setBrush(Qt::gray);//填充颜色
    painter.drawRect(10,10,1600,900);//1600*900界面（≈16:9），相对于框体的起点坐标（10,10）
    painter.drawPixmap(10,10,1600,900,QPixmap(":/myImage/images/background.jpg"));
}
